
package com.bei_en.teacher.management.model.system.vo;

import java.util.Date;
import javax.validation.constraints.*;
import org.hibernate.validator.constraints.*;
import com.bei_en.teacher.management.model.BaseVo;
import com.bei_en.teacher.management.model.system.bean.SystemLogs;

/**
 * 用于前端页面数据传递
 *
 * @author Longqs
 * @date 2016-6-15 11:43:10
 */
public class SystemLogsVo extends BaseVo {

    private SystemLogs systemLogs;

    public SystemLogsVo() {

	this.systemLogs = new SystemLogs();
    }

    public SystemLogsVo(SystemLogs systemLogs) {

	this.systemLogs = systemLogs;
    }

    public SystemLogs getSystemLogs() {

	return this.systemLogs;
    }

    public void setSystemLogs(SystemLogs systemLogs) {

	this.systemLogs = systemLogs;
    }

    public void setId(Integer value) {

	this.systemLogs.setId(value);
    }

    public Integer getId() {

	return this.systemLogs.getId();
    }

    public void setUserId(Integer value) {

	this.systemLogs.setUserId(value);
    }

    @NotNull
    public Integer getUserId() {

	return this.systemLogs.getUserId();
    }

    public void setContent(String value) {

	this.systemLogs.setContent(value);
    }

    @NotBlank
    @Length(max = 256)
    public String getContent() {

	return this.systemLogs.getContent();
    }

    public void setType(Integer value) {

	this.systemLogs.setType(value);
    }

    @NotNull
    @Max(127)
    public Integer getType() {

	return this.systemLogs.getType();
    }

    public void setIp(String value) {

	this.systemLogs.setIp(value);
    }

    @NotBlank
    @Length(max = 45)
    public String getIp() {

	return this.systemLogs.getIp();
    }

    public void setCreateTime(Date value) {

	this.systemLogs.setCreateTime(value!=null ? (int) (value.getTime()/1000) : 0);
    }

    public Date getCreateTime() {

	Integer time = this.systemLogs.getCreateTime();
	if (time!=null&&time!=0)
	    return new Date(Long.valueOf(time)*1000);
	else
	    return null;
    }

}